﻿var grid4 = ref.datagrid4,
    editor4 = grid4.getColumns()[0].getEditor(),
    store4 = grid4.getStore();

if (e.data.Company === 'JLRC') {
    var r = editor4.getStore().findRecord('code', e.data.DescriptionOfSuppliesServices),
        item, items = [];

    editor4.getStore().remove(r);
    for (var i = 0; i < store4.data.items.length; i++) {
        item = store4.data.items[i].data;
        if (item.DescriptionOfSuppliesServices == e.data.DescriptionOfSuppliesServices) {
            items[item.id] = store4.data.items[i];
        }
    }
    for (var key in items) {
        store4.remove(items[key]);
    }
}